package pl.mmirski.functests.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class LoginPage extends Page {

	protected String URL = "http://demo.bananascrum.com/login";
	
	public LoginPage(WebDriver driver) {
		super(driver);
	}

	public SprintBacklogPage logIn(String user, String password) {		
		inputText(By.id("login"),user);
		inputText(By.id("password"), password);
		clickOnElement(By.className("button"));
		return new SprintBacklogPage(driver);
	}
	
	public void open() {
		super.open(URL);
	}
	
	public boolean isLoginIncorrect() {
		return isTextPresent(By.id("flash"),
				"Login failed Type user 'admin' with password 'password'");
	}
	
	
}
